<!DOCTYPE html>
<html lang="en">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>精彩瞬间 - 可漾官网</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta http-equiv="keywords" content="可漾  可漾官网   可漾红豆薏米水  可漾五红汤  可漾红豆水  可漾绿豆水  可漾牛蒡茶  可漾产品  山东可漾饮料有限公司" />
    <meta http-equiv="description"
      content="山东可漾饮料有限公司在以红豆薏米水为代表的谷物饮品方面已经形成了完善的研发、生产和销售体系，并申请了红豆水萃取提纯技术专利，产品一经上市便热销全网。其中抖音、淘宝平台销售额在同类产品中遥遥领先。" />
    <meta name="keywords" content="可漾  可漾官网   可漾红豆薏米水  可漾五红汤  可漾红豆水  可漾绿豆水  可漾牛蒡茶  可漾产品  山东可漾饮料有限公司" />
    <meta name="description"
      content="山东可漾饮料有限公司在以红豆薏米水为代表的谷物饮品方面已经形成了完善的研发、生产和销售体系，并申请了红豆水萃取提纯技术专利，产品一经上市便热销全网。其中抖音、淘宝平台销售额在同类产品中遥遥领先。" />
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <link rel="shortcut icon" href="../favicon.ico" type="image/x-icon" />
    <link rel="bookmark" href="../favicon.ico" />
    <meta name="viewport" content="user-scalable=yes, width=device-width, initial-scale=0.5">
    <link rel="stylesheet" href="../static/css/main.css">
    <link rel="stylesheet" href="../static/css/header.css">
    <link rel="stylesheet" href="../static/css/wonderfulmoment.min.css">
    <link rel="stylesheet" href="../static/css/footer.min.css">
    <link rel="stylesheet" href="../static/libs/swiper-bundle.min.css">
  </head>
  <body>
  <header>
    <div class="nav-box">
      <div id="logo" class="fl">
        <a href="../index.html"><img src="../static/images/Logo.png" alt="可漾"></a>
      </div>
      <ul class="nav fl clear">
        <a href="../index.html" class="nav-item nav-item1">首页</a>
        <a href="./about.html" class="nav-item">关于我们</a>  
        <span class="nav-item-wrap">
          <a href="./product.html" class="nav-item">
            <span class="nav-span">可漾产品</span>
          </a>
          <ul class="nav-list nav-list-prod">
          </ul>
        </span>  
        <span class="nav-item-wrap nav-item-wrap2">
          <a href="./brandnew.html" class="nav-item active">
            <span class="nav-span">企业动态</span>
          </a>
          <ul class="nav-list nav-list2 nav-list-dynamic">
            <li class="nav-li">
              <a href="./brandnew.html">品牌新闻</a>
            </li>
            <li class="nav-li">
              <a href="./enterpriseactivity.html">企业活动</a>
            </li>
            <li class="nav-li">
              <a href="./wonderfulmoment.html">精彩瞬间</a>
            </li>
          </ul>
        </span>
        <a href="./join.html" class="nav-item">加入我们</a>  
      </ul>
    </div>
  </header>
  <main>
    <ul class="title-box flex">
      <li>
        <h1 class="main-title">精彩瞬间</h1>
        <p class="main-desc"></p>
      </li>
      <li class="tab flex">
        <p><span class="video-tab active">视频</span></p>
        <p><span class="img-tab">图集</span></p>
      </li>
    </ul>
    <ul>

      <!-- 视频列表  -->
      <li id="videoBox" class="video-box">
        <h2 class="video-recog-title">推荐视频</h2>
        <dl class="video-box-wrap flex">
          <dt class="main-video">
            <div class="video-wrap scale">
              <!-- <video id="main-video" controls style="width: 100%;height: 100%;object-fit: fill;"></video> -->
              <img class="video-main-poster scale-img animate-transition" src="" alt="">
            </div>
            <h3 class="video-name word-hidden"></h3>
          </dt>
          <ul class="sub-video flex-column">
          </ul>
        </dl>
        <!-- 更多 视频 -->
        <h2 class="more">更多视频</h2>
        <ul class="more-ul">
          <div class="swiper videoSwiper">
            <div class="swiper-wrapper video-swiper-wrapper">
            </div>
          </div>
          <div class="swiper-button-next"></div>
          <div class="swiper-button-prev"></div>
        </ul>
      </li>

      <!-- 图片列表 -->
      <li id="imgBox" class="img-box">
        <h2 class="img-recog-title">图集名称</h2>
        <dl class="images-box flex">
          <dt class="pointer">
            <div class="scale"><img class="scale-img animate-transition" src="" alt=""></div>
            <h2 class="img-title word-hidden"></h2>
          </dt>
          <ul class="clear img-ul">
          </ul>
        </dl>

        <h2 class="img-more-title">更多图集</h2>
        <ul class="img-more-ul">
          <div class="swiper imgSwiper">
            <div class="swiper-wrapper img-swiper-wrapper">
            </div>
          </div>
          <div class="swiper-button-next swiper-button-next2"></div>
          <div class="swiper-button-prev swiper-button-prev2"></div>
        </ul>
      </li>
    </ul>
  </main>
  <!-- 底部区域 -->
  <footer>
    <div class="footer flex">
      <ul class="link-box flex">
      <li>
        <h3>关于我们</h3>
        <p><a href="./about.html#about-box">企业介绍</a></p>
        <p><a href="./about.html#mission-box">企业使命</a></p>
        <p><a href="./about.html#roadmap">企业发展</a></p>
      </li>
      <li class="footer-prod-list">
      </li>
      <li>
        <h3>企业动态</h3>
        <p><a href="./brandnew.html">品牌新闻</a></p>
        <p><a href="./enterpriseactivity.html">企业活动</a></p>
        <p><a href="./wonderfulmoment.html">精彩瞬间</a></p>
      </li>
      <li>
        <h3>加入我们</h3>
        <p><a href="./join.html">未来展望</a></p>
        <p><a href="./join.html">招商加盟</a></p>
      </li>
    </ul>
    <ul class="addr-box">
      <h2>怕湿气，喝可漾</h2>
      <p>山东可漾饮料有限公司</p>
      <p>售后服务热线：4006279199</p>
      <p>地址：山东省潍坊市坊子区黄旗堡街办一马路</p>
      <ul class="feedback flex-start">
        <li class="qr">
          <img src="../static/images/qrcode.png" alt="">
          <span>关注微信公众号</span>
          <img class="qrcode-scan" src="../static/images/qrcode-scan.png" alt="">
        </li>
      </ul>
    </ul>
    </div>
    <div class="right"><a href="https://beian.miit.gov.cn/#/Integrated/index">鲁ICP备19040840号-1</a></div>
  </footer>
  </body>
  <script src="../static/js/master.js"></script>
  <script src="../static/libs/jquery-1.10.1.min.js"></script>
  <script src="../static/libs/swiper-bundle.min.js"></script>
  <script>
    $(function() {
      var baseUrl = 'http://guanwang.keyangyinliao.com/api';
    // 商品列表
      var prodListData = [];
      getProdList();
      function getProdList() {
        $.ajax({
          url: baseUrl + '/ad',
          type: 'get',
          dataType: 'json',
          success: function (res) {
            if (res.code !== 200) return;
            prodListData = res.data;
            initNavProds()
          }
        })
      }

      function initNavProds() {
        var prodListHeadSubHtml = '',
        footerProdListHtml = '<h3>可漾产品</h3>';

        $.each(prodListData, function(i) {
          prodListHeadSubHtml += '<li class="nav-li" data-id=' + prodListData[i].id + '>' + prodListData[i].title + '</li>'
       
          footerProdListHtml += '<p><a href="./product.html?id=' + prodListData[i].id + '">' + prodListData[i].title + '</a></p>';
        })


        // 头部导航[产品]下的【子产品】导航
        $('.nav-list-prod').append(prodListHeadSubHtml);
        $('.nav-list-prod .nav-li').each(function(i) {
          $(this).click(function() {
            window.location.href = './product.html?id=' + $(this).attr('data-id');
          })
        })

        // footer里的产品信息
        $('.footer-prod-list').append(footerProdListHtml);
      }

      $('.video-tab').click(function() {
        $(this).addClass('active');
        $('.img-tab').removeClass('active');
        $('#imgBox').hide();
        $('#videoBox').show();
        getMomentList(2, 7);
      });
      $('.img-tab').click(function() {
        $(this).addClass('active');
        $('.video-tab').removeClass('active');
        $('#videoBox').hide();
        $('#imgBox').show();
        getMomentList(1);
      });

      // 精彩瞬间列表
      var momentListData = [],
        monmentListCount = 0,
        momentListHtml = '';
        momentMainDesc = '';
      // 图集:1 视频:2
      getMomentList(2);
      function getMomentList(type) {
        $.ajax({
          url: baseUrl + '/article/listByCategoryName',
          type: 'get',
          dataType: 'json',
          data: {
            category_name: '精彩瞬间',
            type: type,
            offset: 0
          },
          success: function (res) {
            if (res.code !== 200) return;
            monmentListCount = res.data.count;
            momentListData = res.data.list;
            momentMainDesc = res.data.category_desc;

            if (type == 2) {
              initMomentVidesList();
            } else if (type == 1) {
              initMomentImagesList()
            }

            // 设置精彩瞬间下的描述
            if (momentMainDesc) {
              $('.main-desc').text(momentMainDesc);
            }
          }
        })
      }

      // 初始化精彩瞬间列表(视频)
      function initMomentVidesList() {
        // 第一个大的视频
        var firstVideo = momentListData[0];
        // $('#main-video').attr('src', mainVideoSrc);
        // $('.main-video .video-name').text(firstVideo.title);
        $('.video-main-poster').attr('src', firstVideo.banner_img);
        $('.video-name').text(firstVideo.title).attr('title', firstVideo.title);

        // 第一个视频的点击查看详情
        $('.video-wrap').click(function() {
          // $('.video-preview-box').show();
          // $('#my-video').attr('src', firstVideo.video);
          window.location.href = './detail.html?id=' + firstVideo.id + '&category=' + firstVideo.article_categorie.name;
        })

        // 右侧3个小的视频
        var endVideo = momentListData.slice(1, 4);
        var endVideoHtml = '';
        $.each(endVideo, function(j) {
          endVideoHtml += '<li>' +
            '<div class="video-sub-wrap scale" data-id="' + endVideo[j].id +'" data-category="' + endVideo[j].article_categorie.name +'">' +
            '<img class="scale-img animate-transition" src="' + endVideo[j].banner_img + '" alt="" srcset="">' +
            '</div>' +
            '<h3 class="video-name-sub word-hidden">' + endVideo[j].title + '</h3>' +
          '</li>';
        })

        $('.sub-video').empty();
        $('.sub-video').append(endVideoHtml);

        // 侧边3个视频的播放
        $('.video-sub-wrap').each(function(sv) {
          $(this).click(function() {
            // $('.video-preview-box').show();
            // $('#my-video').attr('src', $(this).attr('data-video'));
            window.location.href = './detail.html?id=' + $(this).attr('data-id') + '&category=' + $(this).attr('data-category');
          })
        })

        // 底下3个更多视频
        var moreVideoData = momentListData.slice(4);
        var moreVideoHtml = '';
        // 如果没有更多视频了  则不显示“更多视频及以下内容”
        if (!moreVideoData.length) {
          $('.more').hide();  
          $('.more-ul').hide();
        }

        $('.video-swiper-wrapper').empty();
        $.each(moreVideoData, function(k) {
          videoswiper.appendSlide('<li class="swiper-slide">' +
            '<div class="video-more-wrap scale" title="' + moreVideoData[k].title + '" data-id="'+ moreVideoData[k].id + '" data-category="' + moreVideoData[k].article_categorie.name +'">' +
              '<img class="scale-img animate-transition" src="' + moreVideoData[k].banner_img + '" alt="" srcset="">' +
            '</div>' +
            '<h3 class="video-name-more word-hidden">' + moreVideoData[k].title + '</h3>' +
          '</li>');
        })

        // 底部3个视频的播放
        $('.video-more-wrap').each(function(sv) {
          $(this).click(function() {
            // $('.video-preview-box').show();
            // $('#my-video').attr('src', $(this).attr('data-video'));
            window.location.href = './detail.html?id=' + $(this).attr('data-id') + '&category=' + $(this).attr('data-category');
          })
        })
      }

      function initMomentImagesList() {
        // 第一张主图
        var firstImgData = momentListData[0];
        $('.images-box dt img').attr({'src': firstImgData.banner_img, title: firstImgData.title});
        $('.images-box .img-title').text(firstImgData.desc);
        // 第一个视频的点击查看详情
        $('.images-box dt').click(function() {
          window.location.href = './detail.html?id=' + firstImgData.id + '&category=' + firstImgData.article_categorie.name;
        })

        // 右侧的4张小图
        var restImgData = momentListData.slice(1, 5);
        var restImgHtml = '';
        $.each(restImgData, function(i) {
          restImgHtml += '<li class="fl img-li pointer" title=" ' + restImgData[i].title + ' " data-id="' + restImgData[i].id + '" data-category="' + restImgData[i].article_categorie.name +'">' +
              '<div class="scale"><img class="scale-img animate-transition" src="' + restImgData[i].banner_img + '" alt=""></div>' +
              '<h2 class="img-title word-hidden">' + restImgData[i].title + '</h2>' +
            '</li>'
        })
        $('.img-ul').empty();
        $('.img-ul').append(restImgHtml);
        // 侧边4个小图的查看详情
        $('.img-ul .img-li').each(function(ig) {
          $(this).click(function() {
            window.location.href = './detail.html?id=' + $(this).attr('data-id') + '&category=' + $(this).attr('data-category');
          })
        })

        // 更多图集
        var moreImgData = momentListData.slice(5);
        var moreImgHtml = '';
        var flexStyle = '';
        if (!moreImgData.length) {
          $('.img-more-title').hide();
          $('.img-more-ul').hide();
        }
        // if (moreImgData.length < 4) {
        //   flexStyle = 'flex-li-start'
        // } else {
        //   flexStyle = 'flex-li-wrap'
        // };
        // $('.img-more-ul').addClass(flexStyle);

        $('.img-swiper-wrapper').empty();
        $.each(moreImgData, function(j) {
          imgswiper.appendSlide('<li class="img-more-li swiper-slide pointer" title="' + moreImgData[j].title + '" data-id="' + moreImgData[j].id + '" data-category="' + moreImgData[j].article_categorie.name + '">' +
            '<div class="scale"><img class="scale-img animate-transition" src="' + moreImgData[j].banner_img  + '" alt="" /></div>' +
            '<h2 class="title word-hidden">'+ moreImgData[j].title +'</h2>' +
          '</li>');
        })

        // 更多视频的点击查看详情
        $('.img-more-li').each(function(ig) {
          $(this).click(function() {
            window.location.href = './detail.html?id=' + $(this).attr('data-id') + '&category=' + $(this).attr('data-category');
          })
        })
      }

      // 更多视频的 轮播
      var videoswiper = new Swiper(".videoSwiper", {
        slidesPerView: 3,
        spaceBetween: 30,
        navigation: {
          nextEl: ".swiper-button-next",
          prevEl: ".swiper-button-prev",
        },
      });

      // 更多图集的轮播
      // 更多视频的 轮播
      var imgswiper = new Swiper(".imgSwiper", {
        slidesPerView: 4,
        spaceBetween: 30,
        navigation: {
          nextEl: ".swiper-button-next2",
          prevEl: ".swiper-button-prev2",
        },
      });
    })
  </script>
</html>